package com.ubtechinc.cruzr.launcher2.model.helper;

import android.text.format.DateFormat;
import android.util.Log;
import android.widget.TextView;

import com.ubtechinc.cruzr.launcher2.LauncherApplication;
import com.ubtechinc.cruzr.launcher2.utlis.LogUtils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class ClockHelper {
    public static void updateTimeDegree(TextView text1, TextView text2, TextView text3) {
        if (text1 == null || text2 == null || text3 == null) {
            return;
        }
        long time = System.currentTimeMillis();
        Date date = new Date(time);
        SimpleDateFormat format = new SimpleDateFormat("HH:mm");
       // text1.setText(getTime());
        text1.setText(format.format(date));
        format = new SimpleDateFormat("yyyy/MM/dd");
        text2.setText(format.format(date));
        format = new SimpleDateFormat("EEEE");
        text3.setText(format.format(date));
    }
    public static String getTime(){
        final Calendar now = Calendar.getInstance();
        Date dummyDate = now.getTime();
        String time = DateFormat.getTimeFormat(LauncherApplication.getContext()).format(dummyDate);
        LogUtils.e("当时时间= " + time);
        return time;
    }
}
